package com.asia5b.a5mall.shop.adapter

import android.widget.TextView
import com.asia5b.a5bmall.same.databinding.GoodsitemShoplistBinding
import com.asia5b.a5mall.middleware.model.shop.AbsGoodsModel

import com.asia5b.a5mall.middleware.utils.CurrencyPriceBuilder3
import com.asia5b.a5mall.shop.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/1/11.
 */
class ShopListGoodsAdapter(list:ArrayList<AbsGoodsModel>):
BaseQuickAdapter<AbsGoodsModel, BaseDataBindingHolder<GoodsitemShoplistBinding>>(R.layout.goodsitem_shoplist,list){
    override fun convert(helper: BaseDataBindingHolder<GoodsitemShoplistBinding>, item: AbsGoodsModel) {

        val tv_shoplist_price=helper.getView<TextView>(R.id.tv_shoplist_price)
        CurrencyPriceBuilder3().run{
            textView=tv_shoplist_price
            price=item.absGoodsPrice
            priceList=item.absGoodsPriceList
            build()
        }

        val binding = helper.dataBinding!!
        binding.model=item

    }
}